package com.huilian.iotbox.client.service;

import com.huilian.iotbox.data.common.ServerResponse;
import com.huilian.iotbox.data.dto.*;
import com.huilian.iotbox.data.po.ConsumeRecord;
import com.huilian.iotbox.data.po.Order;
import com.huilian.iotbox.data.vo.DeviceVo;
import com.huilian.iotbox.data.vo.OrderVo;

import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.math.BigDecimal;
import java.security.NoSuchAlgorithmException;
import java.text.ParseException;

/**
 * @author 谢洛涛
 * @date 2021/1/9 11:42
 */
public interface OrderService {

    Integer add(OrderDto orderDto);

    String payNotice(HttpServletRequest request) throws Exception;

    Order findByOutTradeNoAndTotalAmount(String outTradeNo, BigDecimal amount);

    Order convertByPayNotice(PayNotice payNotice, Order order);

    Integer updateOrder(Order order);

    void handleOrder(Order order, PayNotice payNotice) throws InterruptedException;

    void orderHandlingCharge(Order order);

    OrderDto getById(Long orderId);

    Order findById(Long orderId);


    Order findOldOrder(Long orderId);

    Integer updateStatusById(OrderDto order);

    int orderRefund(OrderRefundDto orderRefundDto);

    int updateOrderShoutStatus(Order order);

    AgencyDto getTopAgency(AgencyDto agency, String channelType);

    OrderVo findOrderByPayNo(String payNo, String deviceNo);
}
